
/**
*  Copyright 2002 Sun Microsystems, Inc. All rights reserved.
*/

/**
 *Title Book
 * @author xiaofei
 *@version 1.0
 */

package author;
public class Book {
	private String name;
	private Author author;
	private double price;
	private int gtyInStock;	
	public Book(String name, Author author, double price)
	{
		this.name = name;
		this.author = author;
		this.price = price;
		this.gtyInStock = 0;
	}	
	public Book(String name, Author author, double price, int gtyInStock)
	{
		this.name = name;
		this.author = author;
		this.price = price;
		this.gtyInStock = gtyInStock;
	}	
	public void setPrice(double price)
	{
		this.price = price;
	}	
	public void setGtyInStock(int gtyInStock)
	{
		this.gtyInStock = gtyInStock;
	}	
	public String getName()
	{
		return this.name;
	}	
	public Author getAuthor()
	{
		return this.author;
	}	
	public double getPrice()
	{
		return this.price;
	}	
	public int getGtyInStock()
	{
		return this.gtyInStock;
	}
	public String toString()
	{
		return author.toString() + ";Book's name is " + this.name;
	}
	public String getAuthorName()
	{
		return author.getName();
	}
	public String getAuthorEmail()
	{
		return author.getEmail();
	}
	public char getAuthorGender()
	{
		return author.getGender();
	}
}
